Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dtables and make_tables functions. Small corrections in etable. Update of ipynb notebooks. #614

Merged
merged 26 commits into from
Sep 23, 2024

Conversation

dsliwka
Copy link
Contributor

@dsliwka dsliwka commented Sep 6, 2024

Added two functions to display tables:

  • pf.dtable shows descriptive statistics.
  • pf.make_table displays dataframes as great_tables or latex booktab.
  • Now use make_table also for the "gt" and "tex" output in etable to allow unified layouts.
  • Output type "df" now gives back an unstyled df.

Added a notebook "table-layout.ipynb" to which I moved the etable examples from the stargazer notebook and added a documentation of dtable and make_table as well as some hints on how to generate and use table styles for "gt" output. This is not yet linked to in the _quarto.yaml.

Further small changes:

  • There was a small bug as etable accepts a FixestMulti object but then produces an error message. FixestMulti is now converted into a list of models so that etable now accepts FixestMulti objects without requiring the user to convert them into a list before calling etable.
  • etable now moves the "Intercept" row to the end of the table as this seems to be standard practice in papers (so that the reader focuses on the first explanatory variable which is typically the variable of interest).
  • Updated the ipynb notebooks to new etables functionality.

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Copy link

codecov bot commented Sep 6, 2024

Codecov Report

Attention: Patch coverage is 65.49708% with 118 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
tests/test_dtable.py 19.81% 85 Missing ⚠️
pyfixest/report/summarize.py 85.89% 33 Missing ⚠️
Flag Coverage Δ
core-tests 77.32% <86.01%> (+0.25%) ⬆️
extended-tests ?
tests-vs-fixest 44.08% <7.60%> (-1.39%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
pyfixest/__init__.py 80.00% <100.00%> (ø)
pyfixest/report/__init__.py 100.00% <100.00%> (ø)
tests/test_errors.py 13.79% <ø> (+0.17%) ⬆️
pyfixest/report/summarize.py 88.34% <85.89%> (-1.75%) ⬇️
tests/test_dtable.py 19.81% <19.81%> (ø)

... and 7 files with indirect coverage changes

@s3alfisc s3alfisc linked an issue Sep 6, 2024 that may be closed by this pull request
@s3alfisc
Copy link
Member

pre-commit.ci autofix

@s3alfisc
Copy link
Member

s3alfisc commented Sep 15, 2024

Hi @dsliwka , I just figured out how to run the auto-linter! There are a few style issues that ruff complains about + the mypy static type checker is unhappy with a few things as well. Do you want to try to fix this yourself? Else I will give this a go. Or we can also join forces =)

You can find all errors here: link

For example, there are a few complaints like this one:

pyfixest\report\summarize.py:458: error: Argument "notes" to "make_table" has incompatible type "str | None"; expected "str" [arg-type]

which can be fixed by changing

    notes: str = None,

to

    notes: str = Optional[None],

.

@s3alfisc
Copy link
Member

Slight side point - I was thinking about potentially writing some tests for the functionality in the report module. Do you have an idea on how to potentially tackle this? My initial though was to test that the input data frame to make_table looks the way it is supposed to.

@s3alfisc
Copy link
Member

pre-commit.ci autofix

@s3alfisc s3alfisc merged commit 7b364d4 into py-econometrics:master Sep 23, 2024
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Request to Bring Back DataFrame ouput for 'etable()'
2 participants